package com.mikao.dao;

import com.mikao.entity.UserPoint;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author kenny
 */
public interface UserPointDao extends JpaRepository<UserPoint, Long>, JpaSpecificationExecutor {

    /**
     * 根据收支类型查找积分明细
     *
     * @param type 收支类型
     * @return list
     */
    List<UserPoint> findAllByTypeAndUserIdOrderByCreateTimeDesc(Integer type, Long userId);
}
